package com.example.server.mapper;


import com.example.server.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Usermapper {


    @Select("select * from user where username=#{username} and password=#{password}")
   User se(String username, String password);
    @Insert("insert into user(email,password,username) values(#{email},#{password},#{username})")
    boolean re(String email, String password, String username);
@Select("select * from user where username=#{username} or email=#{email} LIMIT 1")
    User sele(String email,String username);
@Select("select * from user where uid = #{uid}")
    User self(String uid);
    @Update("update user set username = #{username},email = #{email},updated_at = #{updated},sex = #{sex},telephone = #{telephone} where uid = #{uid}")
        boolean update(String username,String email,String updated,int uid,String sex,String telephone);
    @Select("select * from user where username=#{name}")
    User sele2( String name);
@Select("select count(*) from user")
    int select();
@Select("select * from user where username!='admin' ")
    List<User> getall();
@Delete("delete from user where uid = #{id}")
    int deleteuser(int id);
}
